/*
 * @Author: Bennty
 * @Date: 2025-01-07 10:10:46
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-01-08 16:37:41
 * @Description: 请填写简介
 */
import request from '@/utils/request';

/** 新增销售单 */
export const addSaleOrderApi = (data: any) => {
    return request({
        url: '/system/saleOrder',
        method: 'post',
        data: data
    })
};

/** 查询销售单列表 */
export const getSalerOrderListApi = (data: any) => {
    return request({
        url: '/system/saleOrder/list',
        method: 'post',
        data: data
    });
};

/** 获取销售单详细信息 */
export const getSalerOrderDetailApi = (id: any) => {
    return request({
        url: `/system/saleOrder/${id}`,
        method: 'get'
    })
};

/** 修改销售单 */
export const editSalerOrderApi = (data: any) => {
    return request({
        url: `/system/saleOrder`,
        method: 'put',
        data: data
    })
};

/** 销售单打印详情 */
export const printSalerOrderDetailApi = (id: any) => {
    return request({
        url: `/system/saleOrder/getSaleOrderPrintDetail`,
        method: 'get',
        params: {id: id}
    })
};

/** 打印销售单 */
export const printSalerOrderApi = (id: any) => {
    return request({
        url: `/system/saleOrder/print`,
        method: 'put',
        params: {id: id}
    })
};

/** 删除销售单 */
export const deleteSalerOrderApi = (id: any) => {
    return request({
        url: `/system/saleOrder/${id}`,
        method: 'delete'
    })
};

/** 销售审核 */
export const salerExamineApi = (data: any) => {
    return request({
        url: '/system/saleOrder/saleApproval',
        method: 'post',
        data: data
    });
};

/** 获取审批详情 */
export const getSalerExamineDetailsApi = (id: any) => {
    return request({
        url: '/system/saleOrder/approvalDetail',
        method: 'get',
        params:{id: id}
    });
};

/** 财务审核 */
export const financeExamineApi = (data: any) => {
    return request({
        url: '/system/saleOrder/financeApproval',
        method: 'post',
        data: data
    });
};

/** 查看付款凭证 */
export const checkProofApi = (id: any) => {
    return request({
        url: '/system/saleOrder/getFileUrl',
        method: 'get',
        params: {id: id}
    });
};

/** 销售审核 */
export const revokeExamineApi = (id: any) => {
    return request({
        url: '/system/saleOrder/revokeApproval',
        method: 'put',
        params: {id: id}
    });
};